<?php $data = array(
			'title' => '论文系统-首页',
			'css' => array('css/global.css','css/login.css','css/list.css','css/datepicker.css',),
			'js' => array('js/bootstrap-datepicker.js','bootstrap/docs/assets/js/bootstrap-typeahead.js','js/global.js','js/home.js','js/list.js'),
			'menu' => '01',
			'sub_menus' => array('index.php/paper/paper' => '论文管理', 'paper/paper' => '论文列表')
		);
		$this->load->view('templates/header',$data);
$one_month_after = date("m/d/Y",strtotime("next month"));
$form_attributes = array('name' => 'myform', 'id' => 'myform');
?>
<?php $this->load->view('templates/sub_menu',$data);?>

<div class="main clearfix">
	<div class="real-wrap clearfix">
		<?php $this->load->view('templates/paper_template');?>
		<div class="maincontent om pL193">	
			<h3>论文列表</h3>
			<div class="search_panel">
			<?php echo form_open('paper/paper/search',$form_attributes); ?>
				<?php echo form_input('file_name',set_value('file_name', $this->input->post('file_name')), 'class="input-small" placeholder="请输入文件名"'); ?>
				学校: 
				<select name="school" class="span2">
					<option value="">不限</option>
					<?php foreach($schools->result() as $arr): ?>
					<option value="<?=$arr->id?>" <?php if($arr->id == $this->input->post('school')) echo "selected"; ?>  ><?=$arr->name?></option>
					<?php endforeach; ?>
				</select>
			
				专业: 
				<select name="profession" class="span2">
					<option value="">不限</option>
					<?php foreach($professions->result() as $arr): ?>
					<option value="<?=$arr->id?>" <?php if($arr->id == $this->input->post('profession')) echo "selected"; ?> ><?=$arr->name?></option>
					<?php endforeach; ?>
				</select>
			
				层次: 
				<select name="level" class="span2">
					<option value="">不限</option>
					<?php foreach($levels->result() as $arr): ?>
					<option value="<?=$arr->id?>" <?php if($arr->id == $this->input->post('level')) echo "selected"; ?> ><?=$arr->name?></option>
					<?php endforeach; ?>
				</select>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<?php echo form_submit('submit_btn','搜索', 'class="btn" id="search_btn"'); ?>
			<?php echo form_close(); ?>
			</div>
			
		</div>
	</div>
	<div class="real-wrap content contactlist">
		<div class="alert" <?php if(!$notice) echo 'style="display:none;"'; ?>>
		    <button type="button" class="close" data-dismiss="alert">×</button>
		    <p class="red"><?=$notice?></p>
		</div>
		<?php echo $this->table->generate($results); ?>
		<div class="paginator" id="paginator"><?php echo $this->pagination->create_links(); ?></div>
	</div>
</div>


<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none;">
	<?php echo form_open('paper/paper/download/','id="now_download"'); ?>
    <div class="modal-header">
    	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    	<h3 id="myModalLabel">请填写下载设置</h3>
    </div>
    <div class="modal-body">
    	<div class="alert" id="download_error" style="display:none;" >
			    	<button type="button" class="close" data-dismiss="alert">×</button>
			    	<p></p>
			    </div>
    	<p>高校名称 : <?php echo form_input('use_school',set_value('use_school',''),'class="input-medium" placeholder="请填写用于高校" id="use_school" data-provide="typeahead" data-source=\'["天津大学","东北财经大学","大连理工大学","江南大学"]\' data-items="4"'); ?></p>
    	<p>锁定截止时间 : <?php echo form_input('lock_time',set_value('lock_time',$one_month_after),'class="input-medium" id="datepicker" readonly'); ?></p>
    </div>
    <div class="modal-footer">
    	<button class="btn" data-dismiss="modal" aria-hidden="true" id="canner_modal">取消</button>
    	<?php echo form_submit('submit','锁定下载', 'class="btn btn-primary" onclick="after_download(\''.$this->config->base_url().'\');"'); ?>
    </div>
    <?php echo form_close(); ?>
</div>

<?php $this->load->view('templates/footer');?>
<script type="text/javascript">
	$(document).ready(function(){
		$("#paginator a").click(function(e){
			e.preventDefault();
			var src = $(this).attr("href");
			document.forms[0].action=src;
			document.forms[0].submit();
		});
		$("#search_btn").click(function(e){
			e.preventDefault();
			document.forms[0].action='<?php echo $this->config->base_url();?>paper/paper/search';
			document.forms[0].submit();
		});
	});
</script>
